package com.pt.common.constant;

/**
 * 种子相关常量
 */
public class TorrentConstant {
    /**
     * 种子状态：待审核
     */
    public static final int STATUS_PENDING = 0;

    /**
     * 种子状态：正常
     */
    public static final int STATUS_NORMAL = 1;

    /**
     * 种子状态：禁用
     */
    public static final int STATUS_DISABLED = 2;

    /**
     * 种子状态：已删除
     */
    public static final int STATUS_DELETED = -1;

    // 促销状态
    public static final int PROMOTION_NORMAL = 0;
    public static final int PROMOTION_FREE = 1;
    public static final int PROMOTION_2X_UPLOAD = 2;
    public static final int PROMOTION_HALF_DOWNLOAD = 3;
    public static final int PROMOTION_2X_UPLOAD_HALF_DOWNLOAD = 4;

    // 种子健康度阈值
    public static final int HEALTH_DEAD = 0;
    public static final int HEALTH_DANGER = 3;
    public static final int HEALTH_NORMAL = 5;

    // 文件大小单位
    public static final long KB = 1024L;
    public static final long MB = KB * 1024;
    public static final long GB = MB * 1024;
    public static final long TB = GB * 1024;

    /**
     * Tracker汇报间隔（秒）
     */
    public static final int ANNOUNCE_INTERVAL = 1800; // 30分钟

    /**
     * Tracker最小汇报间隔（秒）
     */
    public static final int MIN_ANNOUNCE_INTERVAL = 900; // 15分钟

    /**
     * Peer超时时间（秒）
     */
    public static final int PEER_TIMEOUT = 7200; // 2小时

    /**
     * 最大返回Peer数量
     */
    public static final int MAX_PEERS = 50;

    // 种子文件相关
    public static final String TORRENT_SAVE_PATH = "torrents/";
    public static final long MAX_TORRENT_SIZE = 10 * MB; // 最大种子文件大小
    public static final String[] ALLOWED_EXTENSIONS = {".torrent"};

    /**
     * Peer状态：停止
     */
    public static final int PEER_STATUS_STOPPED = 0;

    /**
     * Peer状态：下载中
     */
    public static final int PEER_STATUS_LEECHING = 1;

    /**
     * Peer状态：做种中
     */
    public static final int PEER_STATUS_SEEDING = 2;

    /**
     * 默认Peer端口范围
     */
    public static final int MIN_PORT = 1024;
    public static final int MAX_PORT = 65535;

    private TorrentConstant() {
        // 私有构造函数，防止实例化
    }
} 